package model;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class LogEntry implements Serializable {
    private LocalDateTime timestamp;
    private String operationType;
    private String operator;
    
    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    public LogEntry(String operationType, String operator) {
        this.timestamp = LocalDateTime.now();
        this.operationType = operationType;
        this.operator = operator;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public String getOperationType() {
        return operationType;
    }

    public String getOperator() {
        return operator;
    }

    @Override
    public String toString() {
        return "时间：" + timestamp.format(DATE_TIME_FORMATTER) + 
               "，操作：" + operationType + 
               "，操作人：" + operator;
    }
} 